
/**************** STUDY 1 ****************/

* Authoritarian Reforms and External Legitimacy, by Calvert W. Jones

* Using Stata/MP 17. Please call up Study1_Data from the appropriate directory.

/* Note that original variable names appear in raw data provided from omnibus survey. 
outcome variable: Q47r1
conditions: experimental conditions (numeric)
condition: labels for experimental conditions
gender: respondent gender
Weight_National: survey weight
Q6r1: age
*/

* Call up raw data file from omnibus survey (note that directory should be adjusted to device)
import delimited "...\Study1_Data", varnames(1) case(preserve) 

* Rename outcome variable
rename Q47r1 Favorability // Outcome var

* Label conditions in preparation for use as factor variable
label var conditions "Conditions"
label define conditions_values 1 "No reform" 2 "Women's rights" 3 "Religious moderation" 4 "Civil freedom" 5 "Liberal education" 6 "Social tolerance" 7 "Environment/climate change"
label values conditions conditions_values

* Create variable for any reform (an aggregate)
gen allReform = 0
replace allReform = 1 if conditions!=1
label var allReform "Reform"

/* Analysis */

regress Favorability allReform [weight=Weight_National]
estimates store fav_AllReform

regress Favorability i.conditions [weight=Weight_National]
estimates store fav

* Create Figure 3 in manuscript

coefplot fav_AllReform fav, headings (allReform="{bf:Any Reform vs. Control}" 2.conditions="{bf:Individual Reforms vs. Control}") xline(0, lcolor(black)) drop(_cons) levels(95 90) graphregion(color(white)) bgcolor(white) mcolor(black) lcolor(black) ciopts(color(black black)) legend(col(1)) xscale(range(-15 15)) legend(off) xlabel(-15 -10 -5 0 5 10 15) scale(1) aspect(.7) xtitle("Effect on Favorability Rating")

* Generate table
esttab fav_AllReform, label se
esttab fav, label se

